package com.xiaoshuidi.cloud.module.member.mapper.card;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xiaoshuidi.cloud.module.member.controller.app.card.vo.MemberUserBankCardDto;
import com.xiaoshuidi.cloud.module.member.controller.app.card.vo.MemberUserBankCardParamDto;
import com.xiaoshuidi.cloud.module.member.controller.app.card.vo.MemberUserBankCardVo;
import com.xiaoshuidi.cloud.module.member.pojo.card.MemberUserBankCardEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @description 租客银行卡Mapper层
 * @author Leo.Li
 * @date 2023-05-19 17:20:47
 * @version generator
 */
@Mapper
public interface MemberUserBankCardMapper extends BaseMapper<MemberUserBankCardEntity> {

    /**
     * 列表查询
     *
     * @param paramDto 筛选条件
     * @return
     */
    @Select({"<script>"

            + "select * "

            + " from member_user_bank_card "

            + " where id != null and status > 0"

            + " order by created_time desc"

            + "</script>"})
    List<MemberUserBankCardDto> list(@Param("dto") MemberUserBankCardParamDto paramDto);


    List<MemberUserBankCardVo> selectMemberBankCardByTenantId(@Param("tenantUserId")Long tenantUserId);

    void updateUserId(@Param("oldUserId")Long oldUserId,@Param("userId") Long userId);
}
